import request from '@/utils/request.js'
// 状态数据
const state = {
	orderInfo: {}
}
const actions = {
	// 获取订单页数据
	async getOrderInfo({commit}) {
		const res = await request('/orderInfo')
		commit('GET_ORDER_INFO', res.orderInfo.data)
	}
}
const mutations = {
	GET_ORDER_INFO(state, val) {
		state.orderInfo = val
	}
}
const getters = {
	// 订单列表
	digestlist: state => state.orderInfo && state.orderInfo.digestlist
}

export default {
	state, actions, mutations, getters
}